import type { SearchParams, SearchResultResponse, SuggList } from "@/types/http"
import request from "@/utils/request"

// 获取联想建议
export const getSuggListApi = (keyword: string) => {
  return request<SuggList>({
    method: 'get',
    url: '/suggestion',
    params: {
      q: keyword
    }
  })
}


// 获取搜索结果
export const getSearchResultApi = (params: SearchParams) => {
  return request<SearchResultResponse>({
    method: 'get',
    url: '/search',
    params
  })
}